package com.lx.zy.project.system.controller;

import com.lx.zy.framework.web.controller.BaseController;
import com.lx.zy.framework.web.page.TableDataInfo;
import com.lx.zy.project.system.domain.SysRole;
import com.lx.zy.project.system.service.ISysRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @program: zy-vue
 * @description: 角色管理 web层
 * @author: Lx
 * @create: 2019-11-04 20:45
 **/
@RestController
@RequestMapping("/system/role")
public class SysRoleController extends BaseController
{
    @Autowired
    private ISysRoleService roleService;

    @PreAuthorize("@ps.hasPermi('system:role:list')")
    @GetMapping("/list")
    public TableDataInfo list(SysRole role)
    {
        startPage();
        List<SysRole> list = roleService.selectRoleList(role);
        return getDataTable(list);
    }
}
